#include #include using namespace std; void fileWrittingExample() { ofstream fout; fout.open("junk.txt",ios_base::_Noreplace); if(!fout.fail()) { for(int i = 0; i < 1000;i++) { fout << i << endl; } fout.close(); } else { cout << "File already exists" << endl; } } void main() { //cout - variable //datatype - describe structure of a variable //intrinsic vs complex //variable vs objects //cout - is an object of type ostream ostream& say = cout; say << "what" << endl; ifstream fin; fin.open("170.cpp", ios_base::_Nocreate); char line[1000]; if(!fin.fail()) { do { fin.getline(line,1000); cout << line << endl; } while(!fin.eof()); //end of file } else { cout << "File not found" << endl; } fin.close(); }